package server.entity;

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneOffset;

public class Comment {


    private String comment;
    private LocalDateTime time;


    public Comment (String comment, LocalDateTime time){
        this.comment=comment;
        this.time=time;

    }


    public long getTimeAsLong(){
        return time.toInstant(ZoneOffset.UTC).toEpochMilli();
    }

    public void setTime(long time){
        this.time = LocalDateTime.ofInstant(Instant.ofEpochMilli(time), ZoneOffset.UTC);
    }

    public LocalDateTime getTime(){
        return this.time;
    }


    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }
}
